#FROM ascdc/jdk8:latest
FROM java:8 as builder
WORKDIR /build
ARG JAR_FILE=target/micro-admin-biz-1.0.0.jar
COPY ${JAR_FILE} app.jar
RUN java -Djarmode=layertools -jar app.jar extract && rm app.jar

FROM java:8
MAINTAINER utrix<123@163.com>
ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
WORKDIR micro-admin-biz

COPY --from=builder /build/dependencies/ ./
COPY --from=builder /build/snapshot-dependencies/ ./
COPY --from=builder /build/spring-boot-loader/ ./
COPY --from=builder /build/application/ ./

EXPOSE 7007

CMD sleep 60; java $JAVA_OPTS org.springframework.boot.loader.JarLauncher